﻿<controls:ChildWindow xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="SmartSpace.UI.Silverlight.Dynamic.Controls.Window.SelectUserWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="300" 
           Title="选择用户">
    <toolkit:BusyIndicator Name="m_busy">
        <Grid x:Name="LayoutRoot" Margin="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Border BorderThickness="1">
                <sdk:DataGrid Name="m_dataGridUsers" AutoGenerateColumns="False" BorderThickness="0" HeadersVisibility="None">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTemplateColumn Header="姓名" Width="*">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <RadioButton GroupName="GroupName" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" VerticalAlignment="Center" IsChecked="{Binding Path=IsSelected,Mode=TwoWay}">
                                        <StackPanel Orientation="Horizontal" Margin="0,2,0,2">
                                            <Image Source="../../Resources/Leader.png" Height="16" Width="16" Margin="0,0,4,0"/>
                                            <TextBlock Text="{Binding Path=DisplayName}" VerticalAlignment="Stretch"/>
                                        </StackPanel>
                                    </RadioButton>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
            </Border>
            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button x:Name="OKButton" Click="OKButton_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../../Resources/accept.png" Margin="0,0,3,0"/>
                        <TextBlock Text="确定"/>
                    </StackPanel>
                </Button>
                <Button x:Name="CancelButton" Click="CancelButton_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../../Resources/cancel.png" Margin="0,0,3,0"/>
                        <TextBlock Text="取消"/>
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
    </toolkit:BusyIndicator>
</controls:ChildWindow>